import React, { Component } from "react";

class Son extends Component {
  render() {
    return (
      <div>
        <h2>Son</h2>
        {this.props.msg}
      </div>
    );
  }
}

class Parent extends Component {
  render() {
    return (
      <div>
        <h2>parent</h2>
        <Son msg={this.props.msg}></Son>
      </div>
    );
  }
}

export default class App extends Component {
  state = {
    msg: "app组件的数据",
  };
  render() {
    return (
      <div>
        <h1>app</h1>
        <Parent msg={this.state.msg}></Parent>
      </div>
    );
  }
}
